<template>
<div>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="最新热度" name="heat"></el-tab-pane>
  </el-tabs>
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="heat"
      label="热度"
      width="180">
      <template slot-scope="scope">
        <el-progress :text-inside="true" :stroke-width="26" :percentage="scope.row.heat"></el-progress>
      </template>
    </el-table-column>
    <el-table-column
      prop="punishTime"
      label="发布时间"
      width="180">
    </el-table-column>
    <el-table-column
      prop="title"
      label="标题"
      >
    </el-table-column>
    <el-table-column
      prop="userName"
      label="作者"
      width="80">
    </el-table-column>
    <el-table-column
      prop="love"
      label="操作"
      width="80">
      <template slot-scope="scope">
        <i class="el-icon-view" style="color: #20a0ff" @click="listen(scope.row)"></i>
      </template>
    </el-table-column>
  </el-table>
</div>
</template>

<script>
import {getLast} from "@/api/read";

export default {
  name: "latestRecommended",
  data() {
    return {
      tableData: []
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      getLast().then(res => {
        this.tableData = res.body.data
      })
    },
    listen(item) {
      this.$router.push({name:'detailSoulSharing',query: {readId: item.readId}})
    },
  }
}
</script>

<style scoped>

</style>
